package com.wanmait.bootdemo.controller;

import com.wanmait.bootdemo.pojo.QuestionType;
import com.wanmait.bootdemo.service.QuestionTypeService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping("/manage/questionType")
public class QuestionTypeController {

    @Resource
    QuestionTypeService questionTypeService;

    @RequestMapping("list")
//    @ResponseBody
    @ModelAttribute("questionTypes")
    public List<QuestionType> list(){
        List<QuestionType> questionTypes = questionTypeService.findAll();

        return questionTypes;
    }

}
